<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>陵水县建设工程决策支持系统</title>
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link rel="stylesheet" href="../static/css/reset.css" th:href="@{/css/reset.css}">
    <link href="../static/js/plugins/My97DatePicker/skin/WdatePicker.css" th:href="@{/js/plugins/My97DatePicker/skin/WdatePicker.css}" rel="stylesheet">
    <link rel="stylesheet" href="../static/js/plugins/icheck-1.x/skins/all.css" th:href="@{/js/plugins/icheck-1.x/skins/all.css}">
    <link rel="stylesheet" href="../static/css/public.css" th:href="@{/css/public.css}">
</head>

<body>
    <div class="wrapper wrapper-content animated fadeInRight">
        <!-- 头部-->
        <div class="title">
            <p>陵水县建设工程决策支持系统</p>
        </div>
        <div class="div_form" style="width: 100%;">
            <div class="sec-filter clearfix">
                <div class="filter-part">
                    <!--类型-->
                    <dl>
                        <dt data-val="">选择日期</dt>
                    </dl>
                </div>
                <input id="startdate" style="color: #000; border: 1px solid #303389;margin-left: 5px;text-align: center"
                    class="Wdate"
                    onClick="WdatePicker({onpicked:function(dp){var newDate=dp.cal.getNewDateStr();setstart(newDate);},dateFmt:'yyyy-MM',skin:'whyGreen',maxDate:'#F{$dp.$D(\'enddate\')}'})" />&nbsp;&nbsp;至&nbsp;
                <input id="enddate" style="color: #000;border: 1px solid #303389;margin-left: 5px;text-align: center"
                    class="Wdate"
                    onclick="WdatePicker({onpicked:function(dp){var newDate=dp.cal.getNewDateStr();setend(newDate);},dateFmt:'yyyy-MM',skin:'whyGreen',minDate:'#F{$dp.$D(\'startdate\')}',maxDate:'%y-12-31'})" />
                <!--选完的条件-->
                <div class="checkbox" style="display: inline-block;margin: 0;padding-left: 3%;">
                    <label class="check-box" style="font-size: 14px;font-weight: 700;">
                        <input type="checkbox" value="option1" id="inlineCheckbox1">&nbsp;&nbsp; 包括私人住宅</label>
                </div>
                <!--数据更新时间-->
                <span class="last-update">
                    <em>现在时间</em>
                    <em id="text">
                        2019-12-30
                    </em>
                </span>
            </div>
        </div>
        <!--导航栏  -->
        <div class="row t-navbar">
            <!--四个角-->
            <div class="adorn lt"></div>
            <div class="adorn rt"></div>
            <div class="adorn lb"></div>
            <div class="adorn rb"></div>
            <div class="tabs">
                <a href="/buildIndex/analysis" class="active">建设工程开工情况</a>
                <a href="/houseconstruction/analysis">房建工程开工情况</a>
                <a href="/municipalEngineering/analysis">市政工程开工情况</a>
            </div>
            <!-- <ul class="tabs">
                <li class="active"><span>建设工程开工情况</span>
                </li>
                <li class=""><span>房建工程开工情况</span>
                </li>
                <li class=""><span>市政工程开工情况</span>
                </li>
            </ul> -->
        </div>

        <!-- 内容主体 -->
        <div class="word-area">
            <div class="content active">
                <div class="row rowmain environment">
                    <div class="col-md-2 left" style="width: 20%;">
                        <div class="box box1">
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">开工项目总览</p>
                            <div style="overflow: auto; height: 85%;">
                                <table class="table-body" style="table-layout:fixed;width: 100%;margin-top: 10px;">
                                    <tbody>
                                        <tr>
                                            <td style="width: 50%;">
                                                <span>当期开工项目总数：</span>
                                                <p>
                                                    <span class="num yellow" style="text-align: right;" id="all">2034</span>
                                                    <span class="rate" id="rate">-5%</span>
                                                </p>
                                            </td>
                                            <td>
                                                <span>当期总金额：</span>
                                                <p>
                                                    <span class="num yellow" style="text-align: right;" id="allt">1478</span>
                                                    <span class="rate" id="ratet">-5%</span>
                                                </p>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 50%;">
                                                <span>当期房建项目数：</span>
                                                <p>
                                                    <span class="num yellow" style="text-align: right;" id="allarea">896</span>
                                                    <span class="rate" id="ratearea">9%</span>
                                                </p>
                                            </td>
                                            <td>
                                                <span>房建项目总金额：</span>
                                                <p>
                                                    <span class="num yellow" style="text-align: right;" id="allareat">865</span>
                                                    <span class="rate" id="rateareat">-5%</span>
                                                </p>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 50%;">
                                                <span>当期市政项目数：</span>
                                                <p>
                                                    <span class="num yellow" style="text-align: right;" id="allshizheng">721</span>
                                                    <span class="rate" id="ratecount">91%</span>
                                                </p>
                                            </td>
                                            <td>
                                                <span>市政项目总金额：</span>
                                                <p>
                                                    <span class="num yellow" style="text-align: right;" id="allshizhengrate">644</span>
                                                    <span class="rate" id="ratemoney">91%</span>
                                                </p>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="box box2">
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">房建市政项目数量占比</p>
                            <div style="overflow: hidden; height: 90%;">
                                <div id="jiansheybp"></div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-7" style="height: 100%;padding: 0;">
                        <div class="box box3">
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <div class="top_tab">
                                <ul class="top_tabs">
                                    <li class="lis">开工数量对比图</li>
                                    <li class="lis">投资金额对比图</li>
                                    <li class="lis active">详细数据</li>
                                </ul>
                            </div>
                            <div class="tab_box-content" style="width: 100%;height: 100%;">
                                <div class="box-content absolute-content abox ">
                                    <div class="col-md-12"
                                        style="text-align: right;color: rgb(173, 194, 255);margin-top: 2%;">
                                        <div class="map-filter">
                                            <span class="filter-item  on" data-type="2">所有项目</span>
                                            <span class="filter-item" data-type="1">房建项目</span>
                                            <span class="filter-item" data-type="0">市政项目</span>
                                        </div>
                                    </div>
                                    <div id="fangjianbar"></div>
                                </div>
                                <div class="box-content absolute-content abox">
                                    <div class="col-md-12"
                                        style="text-align: right;color: rgb(173, 194, 255);margin-top: 2%;">
                                        <div class="map-filter map_filters">
                                            <span class="filter-item f_items  on" data-type="2">所有项目</span>
                                            <span class="filter-item f_items" data-type="1">房建项目</span>
                                            <span class="filter-item f_items" data-type="0">市政项目</span>
                                        </div>
                                    </div>
                                    <div id="fangjianbar2"></div>
                                </div>
                                <div class="box-content absolute-content abox active">
                                    <table border="0" cellpadding="0" cellspacing="0"
                                        style=" width: 100%;word-break:break-all;margin-top: 2%;">
                                        <tbody>
                                            <tr>
                                                <td>
                                                    <div class="page-title"
                                                        style="color: rgb(173, 194, 255);line-height: 30px;">
                                                        <span>全省开工工程项目统计表</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                        <span>单位：数量：个&nbsp;&nbsp;&nbsp;&nbsp;金额：亿元</span>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table class="tbEidt" align="center"
                                                        style=" width: 100%;word-break:break-all;">
                                                        <thead>
                                                            <tr>
                                                                <td class="tdTitle">市县</td>
                                                                <td class="tdContent">总数量(个)</td>
                                                                <td class="tdContent">同比</td>
                                                                <td class="tdContent">总投资</td>
                                                                <td class="tdContent">同比</td>
                                                                <td class="tdContent">房建项目数</td>
                                                                <td class="tdContent">同比</td>
                                                                <td class="tdContent">房建总投资</td>
                                                                <td class="tdContent">同比</td>
                                                                <td class="tdContent">市政项目数</td>
                                                                <td class="tdContent">同比</td>
                                                                <td class="tdContent">市政总投资</td>
                                                                <td class="tdContent">同比</td>
                                                            </tr>
                                                        </thead>
                                                        <tbody id="saletable">
                                                        
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2 left" style="width: 20.66%;margin-left: 1%;">
                        <div class="box box5">
                            <div class="icon-open1" title="放大" id="btn_open_area1">打开弹窗报表</div>
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">全县开工月度趋势</p>
                            <div class="box-content">
                                <div id="jianshenoise1"></div>
                            </div>
                        </div>
                        <div class="box box5">
                            <div class="icon-open1" title="放大" id="btn_open_area2">打开弹窗报表</div>
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">全县投资月度趋势</p>
                            <div class="box-content">
                                <div id="jianshenoise2"></div>
                            </div>
                        </div>
                        <div class="box box5">
                            <!-- <div class="icon-open1" title="放大" id="btn_open_area">打开弹窗报表</div> -->
                            <!--四个角-->
                            <div class="adorn lt"></div>
                            <div class="adorn rt"></div>
                            <div class="adorn lb"></div>
                            <div class="adorn rb"></div>
                            <p class="box-title">"两个确保"成果</p>
                            <div class="box-content" style="overflow: auto;">
                                <table border="0" cellpadding="0" cellspacing="0" class="tbEidt"
                                    style="table-layout:fixed; width: 100%;word-break:break-all; margin-top: 3%;">
                                    <thead>
                                    	<tr>
                                            <td class="tdContent"></td>
                                            <td class="tdContent">"两个确保"前</td>
                                            <td class="tdContent">"两个确保"后</td>
                                            <td class="tdContent">日均增长幅度</td>
                                        </tr>
                                    </thead>
                                    <tbody id="gtable">
                                        
                                    </tbody>
                                </table>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--弹窗类报表-->
        <div class="popup-fullbg undis"></div>
        <div class="popup-report undis" id="right_trend_month12_popup">
            <div class="btn-close">x</div>
            <div class="popup-hd"></div>
            <div class="trend-month12" id="trend-month12"></div>
            <!-- <div class="icon-open3" title="切换" onclick="toggleLines2(0)">切换弹窗报表</div> -->
        </div>
    </div>
    <script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"> </script>
    <script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
    <script src="../static/js/plugins/echarts@3.8.5/echarts.js" th:src="@{/js/plugins/echarts@3.8.5/echarts.js}"></script>
    <script src="../static/js/plugins/My97DatePicker/WdatePicker.js" th:src="@{/js/plugins/My97DatePicker/WdatePicker.js}"></script>
    <script src="../static/js/plugins/icheck-1.x/icheck.js" th:src="@{/js/plugins/icheck-1.x/icheck.js}"></script>
    <script src="../static/js/custom.js" th:src="@{/js/custom.js}"></script>
    <script src="../static/js/common.js" th:src="@{/js/common.js}"></script>
    <script>
        function setstart(newDate) {
            if (newDate.split("-").length > 2) {
                let s = newDate.split("-");
                sessionStorage.removeItem("startyear");
                sessionStorage.setItem("startyear", s[0] + "-" + s[1]);
                sessionStorage.removeItem("startdate");
                sessionStorage.setItem("startdate", newDate);
                // 调用接口
				refresh();
				smartcount();
				proMoney();
            } else {
                sessionStorage.removeItem("startyear");
                sessionStorage.setItem("startyear", newDate);
                // 记录选择时间
                let s = newDate.split("-");
                sessionStorage.removeItem("tyear");
                sessionStorage.setItem("tyear", s[0]);
                sessionStorage.removeItem("tmonth");
                sessionStorage.setItem("tmonth", s[1]);
                refresh();
                smartcount();
                proMoney();
            }
        };

        function setend(newDate) {
            var start = $("#startdate").val();
            if (start > newDate) {
                return;
            } else {
                if (newDate.split("-").length > 2) {
                    let s = newDate.split("-");
                    sessionStorage.removeItem("endyear");
                    sessionStorage.setItem("endyear", s[0] + "-" + s[1]);
                    sessionStorage.removeItem("enddate");
                    sessionStorage.setItem("enddate", newDate);
                     refresh();
                     smartcount();
                     proMoney();
                } else {
                    sessionStorage.removeItem("endyear");
                    sessionStorage.setItem("endyear", newDate);
                    let s = newDate.split("-");
                    sessionStorage.removeItem("eyear");
                    sessionStorage.setItem("eyear", s[0]);
                    sessionStorage.removeItem("emonth");
                    sessionStorage.setItem("emonth", s[1]);
                    // 调用接口
					refresh();
					smartcount();
					proMoney();
                }
            }
        };
        /**
         * 页签选中
         */
        function initNavigator() {
            var currentUrl = location.pathname;
            $(".tabs a").removeClass("active").each(function (idx, item) {
                var tabUrl = $(item).attr("href");
                if (tabUrl == currentUrl) {
                    $(item).addClass("active");
                }
            })
        };
        /**
         * 初始化cookie中条件
         */
        function initCookie() {
            var currentUrl = location.pathname;
            var now = new Date();
            var currentYear = now.getFullYear();
            /* var currentMonth = now.getMonth() + 1;
            if (currentMonth < 10) {
                currentMonth = "0" + currentMonth;
            }; */
            var currentMonth = '01';
            var lastMonth = '12';
            var tyear = sessionStorage.getItem("tyear") ?
                sessionStorage.getItem("tyear") : currentYear;
            var tmonth = sessionStorage.getItem("tmonth") ?
                sessionStorage.getItem("tmonth") : currentMonth;
            var eyear = sessionStorage.getItem("eyear") ?
                sessionStorage.getItem("eyear") : currentYear;
            var emonth = sessionStorage.getItem("emonth") ?
                sessionStorage.getItem("emonth") : lastMonth;
            sessionStorage.removeItem("index");
            var type = "0";
            sessionStorage.removeItem("type");
            sessionStorage.setItem("type", type);
            var selectType = "0";
            sessionStorage.removeItem("selectType");
            sessionStorage.setItem("selectType", selectType);
            sessionStorage.removeItem("year");
            sessionStorage.setItem("tyear",
                tyear);
            sessionStorage.removeItem("tmonth");
            sessionStorage.setItem("tmonth", tmonth);
            sessionStorage.removeItem("eyear");
            sessionStorage.setItem("eyear", eyear);
            sessionStorage.removeItem("emonth");
            sessionStorage.setItem("emonth",
                emonth);
            sessionStorage.removeItem("startyear");
            sessionStorage.setItem("startyear", tyear + "-" + tmonth);
            sessionStorage.removeItem("endyear");
            sessionStorage.setItem("endyear", eyear + "-" + emonth);
        };
        /**
         * 筛选条件选中
         */
        function initFilter() {
            var type = sessionStorage.getItem("type");
            //条件选中
            // var $cb = $(".cb");
            // $cb.prop('checked');
            $('.checkbox input').on(
                // ifCreated ifClicked ifChanged ifChecked ifUnchecked ifDisabled ifEnabled ifDestroyed
                'ifChecked ifUnchecked',
                function (event) {
                    var str = event.type.replace('if', '').toLowerCase();
                    if (str == "checked") {
                        sessionStorage.setItem("type", '1');
                        refresh();
                        if(sessionStorage.getItem("index") == '0'){
                        	smartcount();
                        }else if(sessionStorage.getItem("index") == '1'){
                        	proMoney();
                        }
                    } else if (str == "unchecked") {
                        sessionStorage.removeItem("type");
                        refresh();
                        if(sessionStorage.getItem("index") == '0'){
                        	smartcount();
                        }else if(sessionStorage.getItem("index") == '1'){
                        	proMoney();
                        }
                    }
                }).iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%'
            });
        };
        /*房建市政项目比  */
        function loadpieChart(){
        	var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/buildIndex/compareprotypeall",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var data = res;
                	var legendata = [];
                	var serise =[];
                	var resobj = [];
                	$.each(data, function (idx, obj) {
                		legendata.push(obj.projectType);
                		serise.push(obj.projectNum);
                	});
                	var  result = [];
            		for(var index in legendata){
            		     result.push({name: legendata[index], value: serise[index]});
            		 }; 
                	var ybp = $('#jiansheybp').eq(0).get(0);
                	toChartPie(ybp,legendata,result);
                }
            });
        };
     	// 表格数据
        function dataDetail() {
           $("#saletable").html('正在统计， 请稍等...... ');
            var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/buildIndex/indexalltable",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                    var data = res;
                    var str = '';
                    $.each(data, function (idx, obj) {
                        if (obj.projectCityNum == '陵水县') {
                        	/*当期开工项目总数*/
                        	$('#all').text(obj.totalNum);
                        	$("#rate").text(toPercent(obj.comparedTotalNum));
                        	$("#rate").addClass(isPlus(obj.comparedTotalNum));
                    		/*当期总金额*/
                        	$('#allt').text((obj.totalMoney/10000).toFixed(2));
                        	$('#ratet').text(toPercent(obj.comparedTotalMoney));
                        	$("#ratet").addClass(isPlus(obj.comparedTotalMoney));
                        	/*当期房建项目数*/
                        	$('#allarea').text(obj.totalNumHC);
                        	$('#ratearea').text(toPercent(obj.comparedTotalNumHC));
                        	$("#ratearea").addClass(isPlus(obj.comparedTotalNumHC));
                        	/*房建项目总金额*/
                        	$('#allareat').text((obj.totalMoneyHC/10000).toFixed(2));
                        	$('#rateareat').text(toPercent(obj.comparedTotalMoneyHC));
                        	$("#rateareat").addClass(isPlus(obj.comparedTotalMoneyHC));
                        	/* 当期市政项目数*/
                        	$('#allshizheng').text(obj.totalNumME);
                        	$("#ratecount").text(toPercent(obj.comparedTotalNumME));
                        	$("#ratecount").addClass(isPlus(obj.comparedTotalNumME));
                        	/* 市政项目总金额*/
                        	$('#allshizhengrate').text((obj.totalMoneyME/10000).toFixed(2));
                        	$("#ratemoney").text(toPercent(obj.comparedTotalMoneyME));
                        	$("#ratemoney").addClass(isPlus(obj.comparedTotalMoneyME));
                        };
                        str += '<tr>' +
                        '<td class="tdContent">' + obj.projectCityNum + '</td>' +
                        '<td class="tdContent">' + obj.totalNum + '</td>' +
                        '<td class="tdContent">' + toPercent(obj.comparedTotalNum) + '</td>' +
                        '<td class="tdContent">' + (obj.totalMoney/10000).toFixed(2) + '</td>' +
                        '<td class="tdContent">' + toPercent(obj.comparedTotalMoney) + '</td>' +
                        '<td class="tdContent">' + obj.totalNumHC+ '</td>'  +
                        '<td class="tdContent">' + toPercent(obj.comparedTotalNumHC) + '</td>' +
                        '<td class="tdContent">' + (obj.totalMoneyHC/10000).toFixed(2) + '</td>' +
                        '<td class="tdContent">' + toPercent(obj.comparedTotalMoneyHC) + '</td>' +
                        '<td class="tdContent">' + obj.totalNumME + '</td>' +
                        '<td class="tdContent">' + toPercent(obj.comparedTotalNumME) + '</td>' +
                        '<td class="tdContent">' + (obj.totalMoneyME/10000).toFixed(2) +
                        '</td>' +
                        '<td class="tdContent">' + toPercent(obj.comparedTotalMoneyME) + '</td>' +
                        '</tr>';
                    });
                    $("#saletable").html(str);
                }
            });
        };
        /**=====开工数量对比 ======*/
        function smartcount(){
        	/* var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12"; */
            var now = new Date();
            var currentYear = now.getFullYear();
            var timeLastBegin = (currentYear-1) + "-" + '01-01 00:00:00';
            var timeLastEnd = (currentYear-1) + "-" + '12-31 23:59:59';
            var timeNowBegin = currentYear + "-" + '01-01 00:00:00';
            var timeNowEnd = currentYear + "-" + '12-31 23:59:59';
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            var selectType = sessionStorage.getItem("selectType") ? sessionStorage.getItem("selectType") : "0";
            $.ajax({
                url: "/buildIndex/selectallstartpronumnowandlastdbt",
                data: {
                	"timeNowBegin": timeNowBegin,
                    "timeNowEnd": timeNowEnd,
                    "timeLastBegin": timeLastBegin,
                    "timeLastEnd": timeLastEnd,
                    "isPrivateConstruction": type,
                    "engineeringType":selectType
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var data = res;
                	var legendata = [];
                	legendata.push((currentYear-1) + '年');
                	legendata.push(currentYear + '年');
                	var fangjianbar = $('#fangjianbar').eq(0).get(0);
                	toChartCountBar(legendata,fangjianbar,data,'单位：个 ');
                }
            });
        };
        /**=====投资金额对比图 ======*/
        function proMoney(){
        	/* var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12"; */
            var now = new Date();
            var currentYear = now.getFullYear();
            var timeLastBegin = (currentYear-1) + "-" + '01-01 00:00:00';
            var timeLastEnd = (currentYear-1) + "-" + '12-31 23:59:59';
            var timeNowBegin = currentYear + "-" + '01-01 00:00:00';
            var timeNowEnd = currentYear + "-" + '12-31 23:59:59';
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            var selectType = sessionStorage.getItem("selectType") ? sessionStorage.getItem("selectType") : "0";
            $.ajax({
                url: "/buildIndex/selectallstartpromoneynowandlastdbt",
                data: {
                    "timeNowBegin": timeNowBegin,
                    "timeNowEnd": timeNowEnd,
                    "timeLastBegin": timeLastBegin,
                    "timeLastEnd": timeLastEnd,
                    "isPrivateConstruction": type,
                    "engineeringType":selectType
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var numTotalLastArr = [];
                	var numTotalNowArr = [];
                	for(var i = 0 ; i<res.numTotalLastArr.length; i++ ){
                		numTotalLastArr.push((res.numTotalLastArr[i]/10000).toFixed(2));
            		}
                	for(var i = 0 ; i<res.numTotalNowArr.length; i++ ){
                		numTotalNowArr.push((res.numTotalNowArr[i]/10000).toFixed(2));
            		};
                	var data = {};
                	var legendata = [];
                	legendata.push((currentYear-1) + '年');
                	legendata.push(currentYear + '年');
                	data.projectCityArr = res.projectCityArr;
                	data.numTotalLastArr = numTotalLastArr;
                	data.numTotalNowArr = numTotalNowArr;
                	var fangjianbar = $('#fangjianbar2').eq(0).get(0);
                	toChartCountBar(legendata,fangjianbar,data,'单位：亿元 ');
                }
            });
        };
        /*全省开工月度趋势*/
        function loadlineChart(){
        	var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/buildIndex/startallnummonthzst",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var data = res;
                	var noise1 = $('#jianshenoise1').eq(0).get(0);
                	toDoubleLine1(noise1,data,['开工数量 ','同比 ']);
                }
            });
        };
        /*全省投资月度趋势 */
        function loadlineChart1(){
        	var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/buildIndex/startallmoneymonthzst",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                	var numTotalLastArr = [];
                	var numTotalNowArr = [];
                	for(var i = 0 ; i<res.moneyTotalArr.length; i++ ){
                		numTotalLastArr.push((res.moneyTotalArr[i]/10000).toFixed(2));
            		}
                	for(var i = 0 ; i<res.moneyTotalCompareArr.length; i++ ){
                		numTotalNowArr.push(res.moneyTotalCompareArr[i]);
            		};
                	var data = {};
                	data.month = res.month;
                	data.numTotalArr = numTotalLastArr;
                	data.numTotalCompareArr = numTotalNowArr;
                	var noise2 = $('#jianshenoise2').eq(0).get(0);
                	toDoubleLine1(noise2,data , ['投资金额  ','同比 ']);
                }
            });
        };
        function guarantee(){
        	var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
            var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
            var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
            $.ajax({
                url: "/buildIndex/twoguarantees",
                data: {
                    "timeNowBegin": startyear,
                    "timeNowEnd": endyear,
                    "isPrivateConstruction": type
                },
                //type: "post",
                dataType: "json",
                success: function (res) {
                    var str = '';
                    str = "<tr>"+
                    '<td class="tdContent">发证数量(个)</td>'+
                    '<td class="tdContent">' + res.numBefor + '</td>'+
                    '<td class="tdContent">' +res.numAfter + '</td>'+
                    '<td class="tdContent">'+''+'</td>'+
                "</tr>"+
                "<tr>" +
                    '<td class="tdContent">日均发证(个)</td>'+
                    '<td class="tdContent">' + res.numDayAverageBefor + '</td>'+
                    '<td class="tdContent">' + res.numDayAverageAfter + '</td>'+
                    '<td class="tdContent">' + res.numDayAverageCompare + '</td>'+
                "</tr>" +
                "<tr>"+
                '<td class="tdContent">合同金额(亿元)</td>'+
                '<td class="tdContent">' + res.priceBefor + '</td>'+
                '<td class="tdContent">' + res.priceAfter + '</td>'+
                '<td class="tdContent">' + ''+ '</td>'+
                "</tr>" +
                "<tr>"+
                    '<td class="tdContent">日均金额(亿元)</td>'+
                    '<td class="tdContent">' + res.priceDayAverageBefor + '</td>'+
                    '<td class="tdContent">' + res.priceDayAverageAfter + '</td>'+
                    '<td class="tdContent">' + res.priceDayAverageCompare + '</td>'+
                "</tr>";
                $("#gtable").html(str);
                }
            });
        };
     	//当前时间
        function currentTime() {
            var now = new Date();
            var year = now.getFullYear();
            var month = now.getMonth() + 1;
            var day = now.getDate();

            var hh = now.getHours();
            var mm = now.getMinutes();

            var clock = year + "-";

            if (month < 10) clock += "0";
            clock += month + "-";
            if (day < 10) clock += "0";
            clock += day + " ";
            if (hh < 10)
                clock += "0";
            clock += hh + ":";
            if (mm < 10) clock += '0';
            clock += mm;
            return (clock);
        };
        function toPercent(point){
            if (point==0) {
                return 0;
            }
            var str=Number(point).toFixed();
            str+="%";
            return str;
        };
        function isPlus(point){
       	 if (isNaN(point)){
       	        return "";
       	    } else {
       	        if(Number(point) > 0){
       	            return "rate asc"
       	        } else if(Number(point) < 0){
       	            return "rate desc";
       	        } else {
       	            return "rate";
       	        }
       	    };
        };
      //更新数据
        function refresh() {
           dataDetail();
           guarantee();
           loadpieChart();
           loadlineChart();
           loadlineChart1();
        };
      	//页面初始化。。。
        $(document).ready(function () {
            initCookie();
            initFilter();
            initNavigator();
            refresh();
            var startYear = sessionStorage.getItem("startyear");
            var endYear = sessionStorage.getItem("endyear");
            $("#startdate").val(startYear);
            $("#enddate").val(endYear);
            $("#text").text(currentTime());
            $('.top_tabs .lis').click(function () {
                $(this).addClass('active').siblings().removeClass('active');
                var index = $(this).index();
                $(".tab_box-content .abox").eq(index).show().siblings().hide();
                if ($(this).index() == 0) {
                	sessionStorage.setItem("index",'0');
                	smartcount();
                } else if ($(this).index() == 1) {
                	sessionStorage.setItem("index",'1');
                	proMoney();
                }
            });
            $('body').on('click', '.map-filter .filter-item', function () {
                var curType = $(this).attr('data-type');
                $(this).addClass('on').siblings().removeClass('on');
                if (curType == 1) {
                	sessionStorage.setItem("selectType", "1");
                	smartcount();
                } else if (curType == 0) {
                	sessionStorage.setItem("selectType", "2");
                	smartcount();
                } else {
                	sessionStorage.setItem("selectType", "0");
                	smartcount();
                }
            });
            $('.map_filters').on('click', '.f_items', function (event) {
                event.stopPropagation();
                var curType = $(this).attr('data-type');
                $(this).addClass('on').siblings().removeClass('on');
                if (curType == 1) {
                	sessionStorage.setItem("selectType", "1");
                    proMoney();
                } else if (curType == 0) {
                	sessionStorage.setItem("selectType", "2");
                    proMoney();
                } else {
                	sessionStorage.setItem("selectType", "0");
                    proMoney();
                }
            });
            //打开弹窗报表
            /* $('body').on('click', '.icon-open1', function () {
                $('.popup-fullbg').removeClass('undis');
                $('#right_trend_month12_popup').removeClass('undis');
                // toDoubleLine(right_trend_month12, data3);
            }); */
            //关闭弹窗报表
            $('body').on('click', '.popup-report .btn-close', function () {
                $('.popup-fullbg').addClass('undis');
                $('.popup-report').addClass('undis');
            });
            //关闭弹窗报表
            $('body').on('click', '.popup-fullbg', function () {
                $('.popup-fullbg').addClass('undis');
                $('.popup-report').addClass('undis');
            });
          //打开弹窗报表
            $('body').on('click', '#btn_open_area1', function () {
                $('.popup-fullbg').removeClass('undis');
                $('.popup-report').removeClass('undis');
                var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
                var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
                var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
                $.ajax({
                    url: "/buildIndex/startallnummonthzst",
                    data: {
                        "timeNowBegin": startyear,
                        "timeNowEnd": endyear,
                        "isPrivateConstruction": type
                    },
                    //type: "post",
                    dataType: "json",
                    success: function (res) {
                    	var data = res;
                    	var trend = $('#trend-month12').eq(0).get(0);
                    	toDoubleLine1(trend,data,['开工数量 ','同比 ']);
                    }
                });
            });
          //打开弹窗报表
            $('body').on('click', '#btn_open_area2', function () {
                $('.popup-fullbg').removeClass('undis');
                $('.popup-report').removeClass('undis');
                var startyear = sessionStorage.getItem("startyear") ? sessionStorage.getItem("startyear") : "2019-01";
                var endyear = sessionStorage.getItem("endyear") ? sessionStorage.getItem("endyear") : "2019-12";
                var type = sessionStorage.getItem("type") ? sessionStorage.getItem("type") : "";
                $.ajax({
                    url: "/buildIndex/startallmoneymonthzst",
                    data: {
                        "timeNowBegin": startyear,
                        "timeNowEnd": endyear,
                        "isPrivateConstruction": type
                    },
                    //type: "post",
                    dataType: "json",
                    success: function (res) {
                    	var numTotalLastArr = [];
                    	var numTotalNowArr = [];
                    	for(var i = 0 ; i<res.moneyTotalArr.length; i++ ){
                    		numTotalLastArr.push((res.moneyTotalArr[i]/10000).toFixed(2));
                		}
                    	for(var i = 0 ; i<res.moneyTotalCompareArr.length; i++ ){
                    		numTotalNowArr.push(res.moneyTotalCompareArr[i]);
                		};
                    	var data = {};
                    	data.month = res.month;
                    	data.numTotalArr = numTotalLastArr;
                    	data.numTotalCompareArr = numTotalNowArr;
                    	var trend = $('#trend-month12').eq(0).get(0);
                    	toDoubleLine1(trend,data,['投资金额  ','同比 ']);
                    }
                });
            });
        });
    </script>
</body>
</html>